
#include "../common.h"
#include<signal.h>

static void sig_chld(int sg)
{
	printf("sig_chld--[%d]\n", sg);
	
	return;
}

int main(int argc, char** argv)
{
	pid_t pd;

	if(SIG_ERR == signal(SIGCHLD, sig_chld))
	{
		printf("signal error\n");
		return -1;
	}

	pd = fork();
	if(0 == pd)
	{
		printf("child---\n");
		return 0;
	}
	else if(pd < 0)
	{
		printf("fork error---\n");
		return -1;
	}
	
	pause();

	return 0;
}
